import java.util.Scanner;

public class demo2 {
    public static String fun(String str) {
        int len=str.length();
        int fast=len-1;
        int slow=len;
        String ret = new String();
        while(fast>=0) {
            if(str.charAt(fast)==' ') {
                ret = ret.concat(str.substring(fast+1,slow));
                ret=ret.concat(" ");
                slow=fast;
            } else if(fast==0) {
                ret = ret.concat(str.substring(fast,slow));
            }
            fast-=1;
        }
        return ret;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        System.out.println(fun(str));
    }
}
